import {
	post,
	get,
	put
} from '@/utils/request.js'

/**
 * wxCode校验
 */
export const authCodeApi = (code) => {
	return post(`/auth/code?code=${code}`)
}

/**
 * 获取并解密wx手机号
 */
export const getWxMobileApi = (data) => {
	return post('/auth/getWxMobile', data)
}

/**
 * 手机号登录注册
 */
export const loginApi = (data) => {
	return post('/auth/login', data)
}
/**
 * 手机号获取验证码
 */
export const sendSms = (data) => {
	return post('/sms/send', data)
}
/**
 * 短信登录
****/ 
export const loginBySmsCode = (data) => {
	return post('/auth/loginBySmsCode', data)
}

/**
 * 获取用户/商家详细信息
 */
export const userInfoApi = () => {
	return get('/user/getMerchantInfo')
}

/**
 * 退出登录
 */
export const logoutApi = () => {
	return post('/auth/logout')
}
/**
 *修改客服信息
 */
export const updateCustomInfo = (data) => {
	return put('/user/updateCustomInfo',data)
}
export const updatePwd = (data) => {
	return put('/user/updatePwd',data)
}